package com.itheima.dianming.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.dianming.pojo.domain.SignLog;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface SignLogMapper extends BaseMapper<SignLog> {


    @Select("SELECT \n" +
            "COUNT(t.id) AS num,\n" +
            "(SELECT username FROM tb_stu WHERE id = t.`stu_id` ) AS name\n" +
            "FROM tb_sign t\n" +
            "WHERE t.sign_date = #{date} \n" +
            "GROUP BY t.stu_id")
    public List<Map<String,Object>> listAll(String date);
}
